//
//  HJAudioPlayer.h
//  HMusicPlayer
//
//  Created by hament deng on 14/10/31.
//  Copyright (c) 2014年 HJ. All rights reserved.
//

#import <Foundation/Foundation.h>

#import "HCoreConfig.h"
@class HSongItem,HPlaylistItem,ORGMEngine,DOUAudioStreamer,HMainWC;
@interface HJAudioPlayer : NSObject {
 
}

@property (nonatomic,strong) HSongItem * currentPlaySongItem; //当前正在播放的曲目
@property (nonatomic,strong) NSString * playListID;//当前播放的playlistID
@property (nonatomic,strong) NSMutableDictionary * hadPlayRandomDic;//随机播放时的已经播放的字典表
@property (nonatomic,strong) NSMutableArray * currentSongsQueue;
@property (nonatomic) NSUInteger currentPlayMode;  // 1 :顺序  2:循环  3:随机 4.单曲循环
@property (nonatomic,weak) HMainWC * delegate;
@property (nonatomic,strong) ORGMEngine  * orgmenginePlayer;//播放无损歌曲的
@property (nonatomic,strong) NSNumber * volume; //0~1.0



@property (nonatomic,strong) DOUAudioStreamer * streamPlayerer; // 用来播放coreaudio

@property (assign) HAudioPlayerType currentUsePlayerType;//当前使用的播放器类型
@property (assign,atomic) BOOL shouldUpdateQueue;//是否需要更新队列

+(HJAudioPlayer*)sharePlayer;

#pragma mark -----------一系列播放动作,基类方法--------------
-(void)playSongWithSongItem:(HSongItem*)songitem;



-(void)playAction;
-(void)pauseAction;
-(void)resumeAction;
-(void)stopAction;
-(void)seekToTimeWithFloatValue:(float)value;//0.0~1.0
-(void)setVolumeWithFloatValue:(float)value;//0.0~1.0




#pragma mark 打开/关闭当前歌曲的bookmark
-(void)openBookmarWithCurrentItem;
-(void)closeBookmarWithCurrentItem;

#pragma mark 初始化队列,播放歌曲,一般用于双击动作
-(void)configWithSongList:(NSArray*)songList playSongItem:(HSongItem*)songitem;

#pragma mark 当原播放列表有歌曲更新时候,更新当前播放队列
-(void)updateSongQueueWithSongsArr:(NSMutableArray*)songsArr;
//当文件或id3tag修改时,需要更新队列
-(void)updateQueueSongName:(NSString*)name path:(NSString*)newpath oldPath:(NSString*)oldpath;


#pragma mark 上一首/下一首按钮
-(HSongItem*)getNextSongItemWithActionIsNext:(BOOL)flag;

#pragma mark 根据当前播放模式得出下一首歌曲
-(HSongItem*)theNextSongItem;

#pragma mark 重命名时更改name和path
-(void)renameWithSongItem:(HSongItem*)theNewsongIOtem;

#pragma mark delete songitems in play queue
-(void)deleteWithSongItems:(NSArray*)dSongitems fromItunes:(BOOL)flag;

#pragma mark sort songqueue
-(void)sortTheSongQueue;


#pragma mark 清空当前播放队列
-(void)emptyCurrentPlayQueue;

@end
